<?php include_once "usuariosinfo.php" ?>
<?php

// Create page object
if (!isset($planes_grid)) $planes_grid = new cplanes_grid();

// Page init
$planes_grid->Page_Init();

// Page main
$planes_grid->Page_Main();

// Global Page Rendering event (in userfn*.php)
Page_Rendering();

// Page Rendering event
$planes_grid->Page_Render();
?>
<?php if ($planes->Export == "") { ?>
<script type="text/javascript">

// Page object
var planes_grid = new ew_Page("planes_grid");
planes_grid.PageID = "grid"; // Page ID
var EW_PAGE_ID = planes_grid.PageID; // For backward compatibility

// Form object
var fplanesgrid = new ew_Form("fplanesgrid");
fplanesgrid.FormKeyCountName = '<?php echo $planes_grid->FormKeyCountName ?>';

// Validate form
fplanesgrid.Validate = function() {
	if (!this.ValidateRequired)
		return true; // Ignore validation
	var $ = jQuery, fobj = this.GetForm(), $fobj = $(fobj);
	this.PostAutoSuggest();
	if ($fobj.find("#a_confirm").val() == "F")
		return true;
	var elm, felm, uelm, addcnt = 0;
	var $k = $fobj.find("#" + this.FormKeyCountName); // Get key_count
	var rowcnt = ($k[0]) ? parseInt($k.val(), 10) : 1;
	var startcnt = (rowcnt == 0) ? 0 : 1; // Check rowcnt == 0 => Inline-Add
	var gridinsert = $fobj.find("#a_list").val() == "gridinsert";
	for (var i = startcnt; i <= rowcnt; i++) {
		var infix = ($k[0]) ? String(i) : "";
		$fobj.data("rowindex", infix);
		var checkrow = (gridinsert) ? !this.EmptyRow(infix) : true;
		if (checkrow) {
			addcnt++;
			elm = this.GetElements("x" + infix + "_tasa");
			if (elm && !ew_CheckNumber(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($planes->tasa->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_habilitada");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($planes->habilitada->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_cuotas");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($planes->cuotas->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_gracia");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($planes->gracia->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_descuenta");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($planes->descuenta->FldErrMsg()) ?>");

			// Set up row object
			ew_ElementsToRow(fobj);

			// Fire Form_CustomValidate event
			if (!this.Form_CustomValidate(fobj))
				return false;
		} // End Grid Add checking
	}
	return true;
}

// Check empty row
fplanesgrid.EmptyRow = function(infix) {
	var fobj = this.Form;
	if (ew_ValueChanged(fobj, infix, "financiera", false)) return false;
	if (ew_ValueChanged(fobj, infix, "nombre", false)) return false;
	if (ew_ValueChanged(fobj, infix, "tasa", false)) return false;
	if (ew_ValueChanged(fobj, infix, "habilitada", false)) return false;
	if (ew_ValueChanged(fobj, infix, "cuotas", false)) return false;
	if (ew_ValueChanged(fobj, infix, "gracia", false)) return false;
	if (ew_ValueChanged(fobj, infix, "descuenta", false)) return false;
	return true;
}

// Form_CustomValidate event
fplanesgrid.Form_CustomValidate = 
 function(fobj) { // DO NOT CHANGE THIS LINE!

 	// Your custom validation code here, return false if invalid. 
 	return true;
 }

// Use JavaScript validation or not
<?php if (EW_CLIENT_VALIDATE) { ?>
fplanesgrid.ValidateRequired = true;
<?php } else { ?>
fplanesgrid.ValidateRequired = false; 
<?php } ?>

// Dynamic selection lists
fplanesgrid.Lists["x_financiera"] = {"LinkField":"x_id","Ajax":null,"AutoFill":false,"DisplayFields":["x_Nombre","","",""],"ParentFields":[],"FilterFields":[],"Options":[]};

// Form object for search
</script>
<?php } ?>
<?php if ($planes->getCurrentMasterTable() == "" && $planes_grid->ExportOptions->Visible()) { ?>
<div class="ewListExportOptions"><?php $planes_grid->ExportOptions->Render("body") ?></div>
<?php } ?>
<?php
if ($planes->CurrentAction == "gridadd") {
	if ($planes->CurrentMode == "copy") {
		$bSelectLimit = EW_SELECT_LIMIT;
		if ($bSelectLimit) {
			$planes_grid->TotalRecs = $planes->SelectRecordCount();
			$planes_grid->Recordset = $planes_grid->LoadRecordset($planes_grid->StartRec-1, $planes_grid->DisplayRecs);
		} else {
			if ($planes_grid->Recordset = $planes_grid->LoadRecordset())
				$planes_grid->TotalRecs = $planes_grid->Recordset->RecordCount();
		}
		$planes_grid->StartRec = 1;
		$planes_grid->DisplayRecs = $planes_grid->TotalRecs;
	} else {
		$planes->CurrentFilter = "0=1";
		$planes_grid->StartRec = 1;
		$planes_grid->DisplayRecs = $planes->GridAddRowCount;
	}
	$planes_grid->TotalRecs = $planes_grid->DisplayRecs;
	$planes_grid->StopRec = $planes_grid->DisplayRecs;
} else {
	$bSelectLimit = EW_SELECT_LIMIT;
	if ($bSelectLimit) {
		$planes_grid->TotalRecs = $planes->SelectRecordCount();
	} else {
		if ($planes_grid->Recordset = $planes_grid->LoadRecordset())
			$planes_grid->TotalRecs = $planes_grid->Recordset->RecordCount();
	}
	$planes_grid->StartRec = 1;
	$planes_grid->DisplayRecs = $planes_grid->TotalRecs; // Display all records
	if ($bSelectLimit)
		$planes_grid->Recordset = $planes_grid->LoadRecordset($planes_grid->StartRec-1, $planes_grid->DisplayRecs);
}
$planes_grid->RenderOtherOptions();
?>
<?php $planes_grid->ShowPageHeader(); ?>
<?php
$planes_grid->ShowMessage();
?>
<table class="ewGrid"><tr><td class="ewGridContent">
<div id="fplanesgrid" class="ewForm form-horizontal">
<div id="gmp_planes" class="ewGridMiddlePanel">
<table id="tbl_planesgrid" class="ewTable ewTableSeparate">
<?php echo $planes->TableCustomInnerHtml ?>
<thead><!-- Table header -->
	<tr class="ewTableHeader">
<?php

// Render list options
$planes_grid->RenderListOptions();

// Render list options (header, left)
$planes_grid->ListOptions->Render("header", "left");
?>
<?php if ($planes->id->Visible) { // id ?>
	<?php if ($planes->SortUrl($planes->id) == "") { ?>
		<td><div id="elh_planes_id" class="planes_id"><div class="ewTableHeaderCaption"><?php echo $planes->id->FldCaption() ?></div></div></td>
	<?php } else { ?>
		<td><div><div id="elh_planes_id" class="planes_id">
			<div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><?php echo $planes->id->FldCaption() ?></span><span class="ewTableHeaderSort"><?php if ($planes->id->getSort() == "ASC") { ?><span class="caret ewSortUp"></span><?php } elseif ($planes->id->getSort() == "DESC") { ?><span class="caret"></span><?php } ?></span></div>
        </div></div></td>
	<?php } ?>
<?php } ?>		
<?php if ($planes->financiera->Visible) { // financiera ?>
	<?php if ($planes->SortUrl($planes->financiera) == "") { ?>
		<td><div id="elh_planes_financiera" class="planes_financiera"><div class="ewTableHeaderCaption"><?php echo $planes->financiera->FldCaption() ?></div></div></td>
	<?php } else { ?>
		<td><div><div id="elh_planes_financiera" class="planes_financiera">
			<div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><?php echo $planes->financiera->FldCaption() ?></span><span class="ewTableHeaderSort"><?php if ($planes->financiera->getSort() == "ASC") { ?><span class="caret ewSortUp"></span><?php } elseif ($planes->financiera->getSort() == "DESC") { ?><span class="caret"></span><?php } ?></span></div>
        </div></div></td>
	<?php } ?>
<?php } ?>		
<?php if ($planes->nombre->Visible) { // nombre ?>
	<?php if ($planes->SortUrl($planes->nombre) == "") { ?>
		<td><div id="elh_planes_nombre" class="planes_nombre"><div class="ewTableHeaderCaption"><?php echo $planes->nombre->FldCaption() ?></div></div></td>
	<?php } else { ?>
		<td><div><div id="elh_planes_nombre" class="planes_nombre">
			<div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><?php echo $planes->nombre->FldCaption() ?></span><span class="ewTableHeaderSort"><?php if ($planes->nombre->getSort() == "ASC") { ?><span class="caret ewSortUp"></span><?php } elseif ($planes->nombre->getSort() == "DESC") { ?><span class="caret"></span><?php } ?></span></div>
        </div></div></td>
	<?php } ?>
<?php } ?>		
<?php if ($planes->tasa->Visible) { // tasa ?>
	<?php if ($planes->SortUrl($planes->tasa) == "") { ?>
		<td><div id="elh_planes_tasa" class="planes_tasa"><div class="ewTableHeaderCaption"><?php echo $planes->tasa->FldCaption() ?></div></div></td>
	<?php } else { ?>
		<td><div><div id="elh_planes_tasa" class="planes_tasa">
			<div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><?php echo $planes->tasa->FldCaption() ?></span><span class="ewTableHeaderSort"><?php if ($planes->tasa->getSort() == "ASC") { ?><span class="caret ewSortUp"></span><?php } elseif ($planes->tasa->getSort() == "DESC") { ?><span class="caret"></span><?php } ?></span></div>
        </div></div></td>
	<?php } ?>
<?php } ?>		
<?php if ($planes->habilitada->Visible) { // habilitada ?>
	<?php if ($planes->SortUrl($planes->habilitada) == "") { ?>
		<td><div id="elh_planes_habilitada" class="planes_habilitada"><div class="ewTableHeaderCaption"><?php echo $planes->habilitada->FldCaption() ?></div></div></td>
	<?php } else { ?>
		<td><div><div id="elh_planes_habilitada" class="planes_habilitada">
			<div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><?php echo $planes->habilitada->FldCaption() ?></span><span class="ewTableHeaderSort"><?php if ($planes->habilitada->getSort() == "ASC") { ?><span class="caret ewSortUp"></span><?php } elseif ($planes->habilitada->getSort() == "DESC") { ?><span class="caret"></span><?php } ?></span></div>
        </div></div></td>
	<?php } ?>
<?php } ?>		
<?php if ($planes->cuotas->Visible) { // cuotas ?>
	<?php if ($planes->SortUrl($planes->cuotas) == "") { ?>
		<td><div id="elh_planes_cuotas" class="planes_cuotas"><div class="ewTableHeaderCaption"><?php echo $planes->cuotas->FldCaption() ?></div></div></td>
	<?php } else { ?>
		<td><div><div id="elh_planes_cuotas" class="planes_cuotas">
			<div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><?php echo $planes->cuotas->FldCaption() ?></span><span class="ewTableHeaderSort"><?php if ($planes->cuotas->getSort() == "ASC") { ?><span class="caret ewSortUp"></span><?php } elseif ($planes->cuotas->getSort() == "DESC") { ?><span class="caret"></span><?php } ?></span></div>
        </div></div></td>
	<?php } ?>
<?php } ?>		
<?php if ($planes->gracia->Visible) { // gracia ?>
	<?php if ($planes->SortUrl($planes->gracia) == "") { ?>
		<td><div id="elh_planes_gracia" class="planes_gracia"><div class="ewTableHeaderCaption"><?php echo $planes->gracia->FldCaption() ?></div></div></td>
	<?php } else { ?>
		<td><div><div id="elh_planes_gracia" class="planes_gracia">
			<div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><?php echo $planes->gracia->FldCaption() ?></span><span class="ewTableHeaderSort"><?php if ($planes->gracia->getSort() == "ASC") { ?><span class="caret ewSortUp"></span><?php } elseif ($planes->gracia->getSort() == "DESC") { ?><span class="caret"></span><?php } ?></span></div>
        </div></div></td>
	<?php } ?>
<?php } ?>		
<?php if ($planes->descuenta->Visible) { // descuenta ?>
	<?php if ($planes->SortUrl($planes->descuenta) == "") { ?>
		<td><div id="elh_planes_descuenta" class="planes_descuenta"><div class="ewTableHeaderCaption"><?php echo $planes->descuenta->FldCaption() ?></div></div></td>
	<?php } else { ?>
		<td><div><div id="elh_planes_descuenta" class="planes_descuenta">
			<div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><?php echo $planes->descuenta->FldCaption() ?></span><span class="ewTableHeaderSort"><?php if ($planes->descuenta->getSort() == "ASC") { ?><span class="caret ewSortUp"></span><?php } elseif ($planes->descuenta->getSort() == "DESC") { ?><span class="caret"></span><?php } ?></span></div>
        </div></div></td>
	<?php } ?>
<?php } ?>		
<?php

// Render list options (header, right)
$planes_grid->ListOptions->Render("header", "right");
?>
	</tr>
</thead>
<tbody>
<?php
$planes_grid->StartRec = 1;
$planes_grid->StopRec = $planes_grid->TotalRecs; // Show all records

// Restore number of post back records
if ($objForm) {
	$objForm->Index = -1;
	if ($objForm->HasValue($planes_grid->FormKeyCountName) && ($planes->CurrentAction == "gridadd" || $planes->CurrentAction == "gridedit" || $planes->CurrentAction == "F")) {
		$planes_grid->KeyCount = $objForm->GetValue($planes_grid->FormKeyCountName);
		$planes_grid->StopRec = $planes_grid->StartRec + $planes_grid->KeyCount - 1;
	}
}
$planes_grid->RecCnt = $planes_grid->StartRec - 1;
if ($planes_grid->Recordset && !$planes_grid->Recordset->EOF) {
	$planes_grid->Recordset->MoveFirst();
	if (!$bSelectLimit && $planes_grid->StartRec > 1)
		$planes_grid->Recordset->Move($planes_grid->StartRec - 1);
} elseif (!$planes->AllowAddDeleteRow && $planes_grid->StopRec == 0) {
	$planes_grid->StopRec = $planes->GridAddRowCount;
}

// Initialize aggregate
$planes->RowType = EW_ROWTYPE_AGGREGATEINIT;
$planes->ResetAttrs();
$planes_grid->RenderRow();
if ($planes->CurrentAction == "gridadd")
	$planes_grid->RowIndex = 0;
if ($planes->CurrentAction == "gridedit")
	$planes_grid->RowIndex = 0;
while ($planes_grid->RecCnt < $planes_grid->StopRec) {
	$planes_grid->RecCnt++;
	if (intval($planes_grid->RecCnt) >= intval($planes_grid->StartRec)) {
		$planes_grid->RowCnt++;
		if ($planes->CurrentAction == "gridadd" || $planes->CurrentAction == "gridedit" || $planes->CurrentAction == "F") {
			$planes_grid->RowIndex++;
			$objForm->Index = $planes_grid->RowIndex;
			if ($objForm->HasValue($planes_grid->FormActionName))
				$planes_grid->RowAction = strval($objForm->GetValue($planes_grid->FormActionName));
			elseif ($planes->CurrentAction == "gridadd")
				$planes_grid->RowAction = "insert";
			else
				$planes_grid->RowAction = "";
		}

		// Set up key count
		$planes_grid->KeyCount = $planes_grid->RowIndex;

		// Init row class and style
		$planes->ResetAttrs();
		$planes->CssClass = "";
		if ($planes->CurrentAction == "gridadd") {
			if ($planes->CurrentMode == "copy") {
				$planes_grid->LoadRowValues($planes_grid->Recordset); // Load row values
				$planes_grid->SetRecordKey($planes_grid->RowOldKey, $planes_grid->Recordset); // Set old record key
			} else {
				$planes_grid->LoadDefaultValues(); // Load default values
				$planes_grid->RowOldKey = ""; // Clear old key value
			}
		} else {
			$planes_grid->LoadRowValues($planes_grid->Recordset); // Load row values
		}
		$planes->RowType = EW_ROWTYPE_VIEW; // Render view
		if ($planes->CurrentAction == "gridadd") // Grid add
			$planes->RowType = EW_ROWTYPE_ADD; // Render add
		if ($planes->CurrentAction == "gridadd" && $planes->EventCancelled && !$objForm->HasValue("k_blankrow")) // Insert failed
			$planes_grid->RestoreCurrentRowFormValues($planes_grid->RowIndex); // Restore form values
		if ($planes->CurrentAction == "gridedit") { // Grid edit
			if ($planes->EventCancelled) {
				$planes_grid->RestoreCurrentRowFormValues($planes_grid->RowIndex); // Restore form values
			}
			if ($planes_grid->RowAction == "insert")
				$planes->RowType = EW_ROWTYPE_ADD; // Render add
			else
				$planes->RowType = EW_ROWTYPE_EDIT; // Render edit
		}
		if ($planes->CurrentAction == "gridedit" && ($planes->RowType == EW_ROWTYPE_EDIT || $planes->RowType == EW_ROWTYPE_ADD) && $planes->EventCancelled) // Update failed
			$planes_grid->RestoreCurrentRowFormValues($planes_grid->RowIndex); // Restore form values
		if ($planes->RowType == EW_ROWTYPE_EDIT) // Edit row
			$planes_grid->EditRowCnt++;
		if ($planes->CurrentAction == "F") // Confirm row
			$planes_grid->RestoreCurrentRowFormValues($planes_grid->RowIndex); // Restore form values

		// Set up row id / data-rowindex
		$planes->RowAttrs = array_merge($planes->RowAttrs, array('data-rowindex'=>$planes_grid->RowCnt, 'id'=>'r' . $planes_grid->RowCnt . '_planes', 'data-rowtype'=>$planes->RowType));

		// Render row
		$planes_grid->RenderRow();

		// Render list options
		$planes_grid->RenderListOptions();

		// Skip delete row / empty row for confirm page
		if ($planes_grid->RowAction <> "delete" && $planes_grid->RowAction <> "insertdelete" && !($planes_grid->RowAction == "insert" && $planes->CurrentAction == "F" && $planes_grid->EmptyRow())) {
?>
	<tr<?php echo $planes->RowAttributes() ?>>
<?php

// Render list options (body, left)
$planes_grid->ListOptions->Render("body", "left", $planes_grid->RowCnt);
?>
	<?php if ($planes->id->Visible) { // id ?>
		<td<?php echo $planes->id->CellAttributes() ?>>
<?php if ($planes->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="hidden" data-field="x_id" name="o<?php echo $planes_grid->RowIndex ?>_id" id="o<?php echo $planes_grid->RowIndex ?>_id" value="<?php echo ew_HtmlEncode($planes->id->OldValue) ?>">
<?php } ?>
<?php if ($planes->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $planes_grid->RowCnt ?>_planes_id" class="control-group planes_id">
<span<?php echo $planes->id->ViewAttributes() ?>>
<?php echo $planes->id->EditValue ?></span>
</span>
<input type="hidden" data-field="x_id" name="x<?php echo $planes_grid->RowIndex ?>_id" id="x<?php echo $planes_grid->RowIndex ?>_id" value="<?php echo ew_HtmlEncode($planes->id->CurrentValue) ?>">
<?php } ?>
<?php if ($planes->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<span<?php echo $planes->id->ViewAttributes() ?>>
<?php echo $planes->id->ListViewValue() ?></span>
<input type="hidden" data-field="x_id" name="x<?php echo $planes_grid->RowIndex ?>_id" id="x<?php echo $planes_grid->RowIndex ?>_id" value="<?php echo ew_HtmlEncode($planes->id->FormValue) ?>">
<input type="hidden" data-field="x_id" name="o<?php echo $planes_grid->RowIndex ?>_id" id="o<?php echo $planes_grid->RowIndex ?>_id" value="<?php echo ew_HtmlEncode($planes->id->OldValue) ?>">
<?php } ?>
<a id="<?php echo $planes_grid->PageObjName . "_row_" . $planes_grid->RowCnt ?>"></a></td>
	<?php } ?>
	<?php if ($planes->financiera->Visible) { // financiera ?>
		<td<?php echo $planes->financiera->CellAttributes() ?>>
<?php if ($planes->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<?php if ($planes->financiera->getSessionValue() <> "") { ?>
<span<?php echo $planes->financiera->ViewAttributes() ?>>
<?php echo $planes->financiera->ListViewValue() ?></span>
<input type="hidden" id="x<?php echo $planes_grid->RowIndex ?>_financiera" name="x<?php echo $planes_grid->RowIndex ?>_financiera" value="<?php echo ew_HtmlEncode($planes->financiera->CurrentValue) ?>">
<?php } else { ?>
<select data-field="x_financiera" id="x<?php echo $planes_grid->RowIndex ?>_financiera" name="x<?php echo $planes_grid->RowIndex ?>_financiera"<?php echo $planes->financiera->EditAttributes() ?>>
<?php
if (is_array($planes->financiera->EditValue)) {
	$arwrk = $planes->financiera->EditValue;
	$rowswrk = count($arwrk);
	$emptywrk = TRUE;
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($planes->financiera->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected=\"selected\"" : "";
		if ($selwrk <> "") $emptywrk = FALSE;
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
	}
}
if (@$emptywrk) $planes->financiera->OldValue = "";
?>
</select>
<script type="text/javascript">
fplanesgrid.Lists["x_financiera"].Options = <?php echo (is_array($planes->financiera->EditValue)) ? ew_ArrayToJson($planes->financiera->EditValue, 1) : "[]" ?>;
</script>
<?php } ?>
<input type="hidden" data-field="x_financiera" name="o<?php echo $planes_grid->RowIndex ?>_financiera" id="o<?php echo $planes_grid->RowIndex ?>_financiera" value="<?php echo ew_HtmlEncode($planes->financiera->OldValue) ?>">
<?php } ?>
<?php if ($planes->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<?php if ($planes->financiera->getSessionValue() <> "") { ?>
<span<?php echo $planes->financiera->ViewAttributes() ?>>
<?php echo $planes->financiera->ListViewValue() ?></span>
<input type="hidden" id="x<?php echo $planes_grid->RowIndex ?>_financiera" name="x<?php echo $planes_grid->RowIndex ?>_financiera" value="<?php echo ew_HtmlEncode($planes->financiera->CurrentValue) ?>">
<?php } else { ?>
<select data-field="x_financiera" id="x<?php echo $planes_grid->RowIndex ?>_financiera" name="x<?php echo $planes_grid->RowIndex ?>_financiera"<?php echo $planes->financiera->EditAttributes() ?>>
<?php
if (is_array($planes->financiera->EditValue)) {
	$arwrk = $planes->financiera->EditValue;
	$rowswrk = count($arwrk);
	$emptywrk = TRUE;
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($planes->financiera->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected=\"selected\"" : "";
		if ($selwrk <> "") $emptywrk = FALSE;
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
	}
}
if (@$emptywrk) $planes->financiera->OldValue = "";
?>
</select>
<script type="text/javascript">
fplanesgrid.Lists["x_financiera"].Options = <?php echo (is_array($planes->financiera->EditValue)) ? ew_ArrayToJson($planes->financiera->EditValue, 1) : "[]" ?>;
</script>
<?php } ?>
<?php } ?>
<?php if ($planes->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<span<?php echo $planes->financiera->ViewAttributes() ?>>
<?php echo $planes->financiera->ListViewValue() ?></span>
<input type="hidden" data-field="x_financiera" name="x<?php echo $planes_grid->RowIndex ?>_financiera" id="x<?php echo $planes_grid->RowIndex ?>_financiera" value="<?php echo ew_HtmlEncode($planes->financiera->FormValue) ?>">
<input type="hidden" data-field="x_financiera" name="o<?php echo $planes_grid->RowIndex ?>_financiera" id="o<?php echo $planes_grid->RowIndex ?>_financiera" value="<?php echo ew_HtmlEncode($planes->financiera->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($planes->nombre->Visible) { // nombre ?>
		<td<?php echo $planes->nombre->CellAttributes() ?>>
<?php if ($planes->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $planes_grid->RowCnt ?>_planes_nombre" class="control-group planes_nombre">
<input type="text" data-field="x_nombre" name="x<?php echo $planes_grid->RowIndex ?>_nombre" id="x<?php echo $planes_grid->RowIndex ?>_nombre" size="30" maxlength="200" placeholder="<?php echo $planes->nombre->PlaceHolder ?>" value="<?php echo $planes->nombre->EditValue ?>"<?php echo $planes->nombre->EditAttributes() ?>>
</span>
<input type="hidden" data-field="x_nombre" name="o<?php echo $planes_grid->RowIndex ?>_nombre" id="o<?php echo $planes_grid->RowIndex ?>_nombre" value="<?php echo ew_HtmlEncode($planes->nombre->OldValue) ?>">
<?php } ?>
<?php if ($planes->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $planes_grid->RowCnt ?>_planes_nombre" class="control-group planes_nombre">
<input type="text" data-field="x_nombre" name="x<?php echo $planes_grid->RowIndex ?>_nombre" id="x<?php echo $planes_grid->RowIndex ?>_nombre" size="30" maxlength="200" placeholder="<?php echo $planes->nombre->PlaceHolder ?>" value="<?php echo $planes->nombre->EditValue ?>"<?php echo $planes->nombre->EditAttributes() ?>>
</span>
<?php } ?>
<?php if ($planes->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<span<?php echo $planes->nombre->ViewAttributes() ?>>
<?php echo $planes->nombre->ListViewValue() ?></span>
<input type="hidden" data-field="x_nombre" name="x<?php echo $planes_grid->RowIndex ?>_nombre" id="x<?php echo $planes_grid->RowIndex ?>_nombre" value="<?php echo ew_HtmlEncode($planes->nombre->FormValue) ?>">
<input type="hidden" data-field="x_nombre" name="o<?php echo $planes_grid->RowIndex ?>_nombre" id="o<?php echo $planes_grid->RowIndex ?>_nombre" value="<?php echo ew_HtmlEncode($planes->nombre->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($planes->tasa->Visible) { // tasa ?>
		<td<?php echo $planes->tasa->CellAttributes() ?>>
<?php if ($planes->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $planes_grid->RowCnt ?>_planes_tasa" class="control-group planes_tasa">
<input type="text" data-field="x_tasa" name="x<?php echo $planes_grid->RowIndex ?>_tasa" id="x<?php echo $planes_grid->RowIndex ?>_tasa" size="30" placeholder="<?php echo $planes->tasa->PlaceHolder ?>" value="<?php echo $planes->tasa->EditValue ?>"<?php echo $planes->tasa->EditAttributes() ?>>
</span>
<input type="hidden" data-field="x_tasa" name="o<?php echo $planes_grid->RowIndex ?>_tasa" id="o<?php echo $planes_grid->RowIndex ?>_tasa" value="<?php echo ew_HtmlEncode($planes->tasa->OldValue) ?>">
<?php } ?>
<?php if ($planes->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $planes_grid->RowCnt ?>_planes_tasa" class="control-group planes_tasa">
<input type="text" data-field="x_tasa" name="x<?php echo $planes_grid->RowIndex ?>_tasa" id="x<?php echo $planes_grid->RowIndex ?>_tasa" size="30" placeholder="<?php echo $planes->tasa->PlaceHolder ?>" value="<?php echo $planes->tasa->EditValue ?>"<?php echo $planes->tasa->EditAttributes() ?>>
</span>
<?php } ?>
<?php if ($planes->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<span<?php echo $planes->tasa->ViewAttributes() ?>>
<?php echo $planes->tasa->ListViewValue() ?></span>
<input type="hidden" data-field="x_tasa" name="x<?php echo $planes_grid->RowIndex ?>_tasa" id="x<?php echo $planes_grid->RowIndex ?>_tasa" value="<?php echo ew_HtmlEncode($planes->tasa->FormValue) ?>">
<input type="hidden" data-field="x_tasa" name="o<?php echo $planes_grid->RowIndex ?>_tasa" id="o<?php echo $planes_grid->RowIndex ?>_tasa" value="<?php echo ew_HtmlEncode($planes->tasa->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($planes->habilitada->Visible) { // habilitada ?>
		<td<?php echo $planes->habilitada->CellAttributes() ?>>
<?php if ($planes->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $planes_grid->RowCnt ?>_planes_habilitada" class="control-group planes_habilitada">
<input type="text" data-field="x_habilitada" name="x<?php echo $planes_grid->RowIndex ?>_habilitada" id="x<?php echo $planes_grid->RowIndex ?>_habilitada" size="30" placeholder="<?php echo $planes->habilitada->PlaceHolder ?>" value="<?php echo $planes->habilitada->EditValue ?>"<?php echo $planes->habilitada->EditAttributes() ?>>
</span>
<input type="hidden" data-field="x_habilitada" name="o<?php echo $planes_grid->RowIndex ?>_habilitada" id="o<?php echo $planes_grid->RowIndex ?>_habilitada" value="<?php echo ew_HtmlEncode($planes->habilitada->OldValue) ?>">
<?php } ?>
<?php if ($planes->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $planes_grid->RowCnt ?>_planes_habilitada" class="control-group planes_habilitada">
<input type="text" data-field="x_habilitada" name="x<?php echo $planes_grid->RowIndex ?>_habilitada" id="x<?php echo $planes_grid->RowIndex ?>_habilitada" size="30" placeholder="<?php echo $planes->habilitada->PlaceHolder ?>" value="<?php echo $planes->habilitada->EditValue ?>"<?php echo $planes->habilitada->EditAttributes() ?>>
</span>
<?php } ?>
<?php if ($planes->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<span<?php echo $planes->habilitada->ViewAttributes() ?>>
<?php echo $planes->habilitada->ListViewValue() ?></span>
<input type="hidden" data-field="x_habilitada" name="x<?php echo $planes_grid->RowIndex ?>_habilitada" id="x<?php echo $planes_grid->RowIndex ?>_habilitada" value="<?php echo ew_HtmlEncode($planes->habilitada->FormValue) ?>">
<input type="hidden" data-field="x_habilitada" name="o<?php echo $planes_grid->RowIndex ?>_habilitada" id="o<?php echo $planes_grid->RowIndex ?>_habilitada" value="<?php echo ew_HtmlEncode($planes->habilitada->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($planes->cuotas->Visible) { // cuotas ?>
		<td<?php echo $planes->cuotas->CellAttributes() ?>>
<?php if ($planes->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $planes_grid->RowCnt ?>_planes_cuotas" class="control-group planes_cuotas">
<input type="text" data-field="x_cuotas" name="x<?php echo $planes_grid->RowIndex ?>_cuotas" id="x<?php echo $planes_grid->RowIndex ?>_cuotas" size="30" placeholder="<?php echo $planes->cuotas->PlaceHolder ?>" value="<?php echo $planes->cuotas->EditValue ?>"<?php echo $planes->cuotas->EditAttributes() ?>>
</span>
<input type="hidden" data-field="x_cuotas" name="o<?php echo $planes_grid->RowIndex ?>_cuotas" id="o<?php echo $planes_grid->RowIndex ?>_cuotas" value="<?php echo ew_HtmlEncode($planes->cuotas->OldValue) ?>">
<?php } ?>
<?php if ($planes->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $planes_grid->RowCnt ?>_planes_cuotas" class="control-group planes_cuotas">
<input type="text" data-field="x_cuotas" name="x<?php echo $planes_grid->RowIndex ?>_cuotas" id="x<?php echo $planes_grid->RowIndex ?>_cuotas" size="30" placeholder="<?php echo $planes->cuotas->PlaceHolder ?>" value="<?php echo $planes->cuotas->EditValue ?>"<?php echo $planes->cuotas->EditAttributes() ?>>
</span>
<?php } ?>
<?php if ($planes->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<span<?php echo $planes->cuotas->ViewAttributes() ?>>
<?php echo $planes->cuotas->ListViewValue() ?></span>
<input type="hidden" data-field="x_cuotas" name="x<?php echo $planes_grid->RowIndex ?>_cuotas" id="x<?php echo $planes_grid->RowIndex ?>_cuotas" value="<?php echo ew_HtmlEncode($planes->cuotas->FormValue) ?>">
<input type="hidden" data-field="x_cuotas" name="o<?php echo $planes_grid->RowIndex ?>_cuotas" id="o<?php echo $planes_grid->RowIndex ?>_cuotas" value="<?php echo ew_HtmlEncode($planes->cuotas->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($planes->gracia->Visible) { // gracia ?>
		<td<?php echo $planes->gracia->CellAttributes() ?>>
<?php if ($planes->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $planes_grid->RowCnt ?>_planes_gracia" class="control-group planes_gracia">
<input type="text" data-field="x_gracia" name="x<?php echo $planes_grid->RowIndex ?>_gracia" id="x<?php echo $planes_grid->RowIndex ?>_gracia" size="30" placeholder="<?php echo $planes->gracia->PlaceHolder ?>" value="<?php echo $planes->gracia->EditValue ?>"<?php echo $planes->gracia->EditAttributes() ?>>
</span>
<input type="hidden" data-field="x_gracia" name="o<?php echo $planes_grid->RowIndex ?>_gracia" id="o<?php echo $planes_grid->RowIndex ?>_gracia" value="<?php echo ew_HtmlEncode($planes->gracia->OldValue) ?>">
<?php } ?>
<?php if ($planes->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $planes_grid->RowCnt ?>_planes_gracia" class="control-group planes_gracia">
<input type="text" data-field="x_gracia" name="x<?php echo $planes_grid->RowIndex ?>_gracia" id="x<?php echo $planes_grid->RowIndex ?>_gracia" size="30" placeholder="<?php echo $planes->gracia->PlaceHolder ?>" value="<?php echo $planes->gracia->EditValue ?>"<?php echo $planes->gracia->EditAttributes() ?>>
</span>
<?php } ?>
<?php if ($planes->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<span<?php echo $planes->gracia->ViewAttributes() ?>>
<?php echo $planes->gracia->ListViewValue() ?></span>
<input type="hidden" data-field="x_gracia" name="x<?php echo $planes_grid->RowIndex ?>_gracia" id="x<?php echo $planes_grid->RowIndex ?>_gracia" value="<?php echo ew_HtmlEncode($planes->gracia->FormValue) ?>">
<input type="hidden" data-field="x_gracia" name="o<?php echo $planes_grid->RowIndex ?>_gracia" id="o<?php echo $planes_grid->RowIndex ?>_gracia" value="<?php echo ew_HtmlEncode($planes->gracia->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($planes->descuenta->Visible) { // descuenta ?>
		<td<?php echo $planes->descuenta->CellAttributes() ?>>
<?php if ($planes->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $planes_grid->RowCnt ?>_planes_descuenta" class="control-group planes_descuenta">
<input type="text" data-field="x_descuenta" name="x<?php echo $planes_grid->RowIndex ?>_descuenta" id="x<?php echo $planes_grid->RowIndex ?>_descuenta" size="30" placeholder="<?php echo $planes->descuenta->PlaceHolder ?>" value="<?php echo $planes->descuenta->EditValue ?>"<?php echo $planes->descuenta->EditAttributes() ?>>
</span>
<input type="hidden" data-field="x_descuenta" name="o<?php echo $planes_grid->RowIndex ?>_descuenta" id="o<?php echo $planes_grid->RowIndex ?>_descuenta" value="<?php echo ew_HtmlEncode($planes->descuenta->OldValue) ?>">
<?php } ?>
<?php if ($planes->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $planes_grid->RowCnt ?>_planes_descuenta" class="control-group planes_descuenta">
<input type="text" data-field="x_descuenta" name="x<?php echo $planes_grid->RowIndex ?>_descuenta" id="x<?php echo $planes_grid->RowIndex ?>_descuenta" size="30" placeholder="<?php echo $planes->descuenta->PlaceHolder ?>" value="<?php echo $planes->descuenta->EditValue ?>"<?php echo $planes->descuenta->EditAttributes() ?>>
</span>
<?php } ?>
<?php if ($planes->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<span<?php echo $planes->descuenta->ViewAttributes() ?>>
<?php echo $planes->descuenta->ListViewValue() ?></span>
<input type="hidden" data-field="x_descuenta" name="x<?php echo $planes_grid->RowIndex ?>_descuenta" id="x<?php echo $planes_grid->RowIndex ?>_descuenta" value="<?php echo ew_HtmlEncode($planes->descuenta->FormValue) ?>">
<input type="hidden" data-field="x_descuenta" name="o<?php echo $planes_grid->RowIndex ?>_descuenta" id="o<?php echo $planes_grid->RowIndex ?>_descuenta" value="<?php echo ew_HtmlEncode($planes->descuenta->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$planes_grid->ListOptions->Render("body", "right", $planes_grid->RowCnt);
?>
	</tr>
<?php if ($planes->RowType == EW_ROWTYPE_ADD || $planes->RowType == EW_ROWTYPE_EDIT) { ?>
<script type="text/javascript">
fplanesgrid.UpdateOpts(<?php echo $planes_grid->RowIndex ?>);
</script>
<?php } ?>
<?php
	}
	} // End delete row checking
	if ($planes->CurrentAction <> "gridadd" || $planes->CurrentMode == "copy")
		if (!$planes_grid->Recordset->EOF) $planes_grid->Recordset->MoveNext();
}
?>
<?php
	if ($planes->CurrentMode == "add" || $planes->CurrentMode == "copy" || $planes->CurrentMode == "edit") {
		$planes_grid->RowIndex = '$rowindex$';
		$planes_grid->LoadDefaultValues();

		// Set row properties
		$planes->ResetAttrs();
		$planes->RowAttrs = array_merge($planes->RowAttrs, array('data-rowindex'=>$planes_grid->RowIndex, 'id'=>'r0_planes', 'data-rowtype'=>EW_ROWTYPE_ADD));
		ew_AppendClass($planes->RowAttrs["class"], "ewTemplate");
		$planes->RowType = EW_ROWTYPE_ADD;

		// Render row
		$planes_grid->RenderRow();

		// Render list options
		$planes_grid->RenderListOptions();
		$planes_grid->StartRowCnt = 0;
?>
	<tr<?php echo $planes->RowAttributes() ?>>
<?php

// Render list options (body, left)
$planes_grid->ListOptions->Render("body", "left", $planes_grid->RowIndex);
?>
	<?php if ($planes->id->Visible) { // id ?>
		<td>
<?php if ($planes->CurrentAction <> "F") { ?>
<?php } else { ?>
<span id="el$rowindex$_planes_id" class="control-group planes_id">
<span<?php echo $planes->id->ViewAttributes() ?>>
<?php echo $planes->id->ViewValue ?></span>
</span>
<input type="hidden" data-field="x_id" name="x<?php echo $planes_grid->RowIndex ?>_id" id="x<?php echo $planes_grid->RowIndex ?>_id" value="<?php echo ew_HtmlEncode($planes->id->FormValue) ?>">
<?php } ?>
<input type="hidden" data-field="x_id" name="o<?php echo $planes_grid->RowIndex ?>_id" id="o<?php echo $planes_grid->RowIndex ?>_id" value="<?php echo ew_HtmlEncode($planes->id->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($planes->financiera->Visible) { // financiera ?>
		<td>
<?php if ($planes->CurrentAction <> "F") { ?>
<?php if ($planes->financiera->getSessionValue() <> "") { ?>
<span<?php echo $planes->financiera->ViewAttributes() ?>>
<?php echo $planes->financiera->ListViewValue() ?></span>
<input type="hidden" id="x<?php echo $planes_grid->RowIndex ?>_financiera" name="x<?php echo $planes_grid->RowIndex ?>_financiera" value="<?php echo ew_HtmlEncode($planes->financiera->CurrentValue) ?>">
<?php } else { ?>
<select data-field="x_financiera" id="x<?php echo $planes_grid->RowIndex ?>_financiera" name="x<?php echo $planes_grid->RowIndex ?>_financiera"<?php echo $planes->financiera->EditAttributes() ?>>
<?php
if (is_array($planes->financiera->EditValue)) {
	$arwrk = $planes->financiera->EditValue;
	$rowswrk = count($arwrk);
	$emptywrk = TRUE;
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($planes->financiera->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected=\"selected\"" : "";
		if ($selwrk <> "") $emptywrk = FALSE;
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
	}
}
if (@$emptywrk) $planes->financiera->OldValue = "";
?>
</select>
<script type="text/javascript">
fplanesgrid.Lists["x_financiera"].Options = <?php echo (is_array($planes->financiera->EditValue)) ? ew_ArrayToJson($planes->financiera->EditValue, 1) : "[]" ?>;
</script>
<?php } ?>
<?php } else { ?>
<span<?php echo $planes->financiera->ViewAttributes() ?>>
<?php echo $planes->financiera->ViewValue ?></span>
<input type="hidden" data-field="x_financiera" name="x<?php echo $planes_grid->RowIndex ?>_financiera" id="x<?php echo $planes_grid->RowIndex ?>_financiera" value="<?php echo ew_HtmlEncode($planes->financiera->FormValue) ?>">
<?php } ?>
<input type="hidden" data-field="x_financiera" name="o<?php echo $planes_grid->RowIndex ?>_financiera" id="o<?php echo $planes_grid->RowIndex ?>_financiera" value="<?php echo ew_HtmlEncode($planes->financiera->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($planes->nombre->Visible) { // nombre ?>
		<td>
<?php if ($planes->CurrentAction <> "F") { ?>
<span id="el$rowindex$_planes_nombre" class="control-group planes_nombre">
<input type="text" data-field="x_nombre" name="x<?php echo $planes_grid->RowIndex ?>_nombre" id="x<?php echo $planes_grid->RowIndex ?>_nombre" size="30" maxlength="200" placeholder="<?php echo $planes->nombre->PlaceHolder ?>" value="<?php echo $planes->nombre->EditValue ?>"<?php echo $planes->nombre->EditAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_planes_nombre" class="control-group planes_nombre">
<span<?php echo $planes->nombre->ViewAttributes() ?>>
<?php echo $planes->nombre->ViewValue ?></span>
</span>
<input type="hidden" data-field="x_nombre" name="x<?php echo $planes_grid->RowIndex ?>_nombre" id="x<?php echo $planes_grid->RowIndex ?>_nombre" value="<?php echo ew_HtmlEncode($planes->nombre->FormValue) ?>">
<?php } ?>
<input type="hidden" data-field="x_nombre" name="o<?php echo $planes_grid->RowIndex ?>_nombre" id="o<?php echo $planes_grid->RowIndex ?>_nombre" value="<?php echo ew_HtmlEncode($planes->nombre->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($planes->tasa->Visible) { // tasa ?>
		<td>
<?php if ($planes->CurrentAction <> "F") { ?>
<span id="el$rowindex$_planes_tasa" class="control-group planes_tasa">
<input type="text" data-field="x_tasa" name="x<?php echo $planes_grid->RowIndex ?>_tasa" id="x<?php echo $planes_grid->RowIndex ?>_tasa" size="30" placeholder="<?php echo $planes->tasa->PlaceHolder ?>" value="<?php echo $planes->tasa->EditValue ?>"<?php echo $planes->tasa->EditAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_planes_tasa" class="control-group planes_tasa">
<span<?php echo $planes->tasa->ViewAttributes() ?>>
<?php echo $planes->tasa->ViewValue ?></span>
</span>
<input type="hidden" data-field="x_tasa" name="x<?php echo $planes_grid->RowIndex ?>_tasa" id="x<?php echo $planes_grid->RowIndex ?>_tasa" value="<?php echo ew_HtmlEncode($planes->tasa->FormValue) ?>">
<?php } ?>
<input type="hidden" data-field="x_tasa" name="o<?php echo $planes_grid->RowIndex ?>_tasa" id="o<?php echo $planes_grid->RowIndex ?>_tasa" value="<?php echo ew_HtmlEncode($planes->tasa->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($planes->habilitada->Visible) { // habilitada ?>
		<td>
<?php if ($planes->CurrentAction <> "F") { ?>
<span id="el$rowindex$_planes_habilitada" class="control-group planes_habilitada">
<input type="text" data-field="x_habilitada" name="x<?php echo $planes_grid->RowIndex ?>_habilitada" id="x<?php echo $planes_grid->RowIndex ?>_habilitada" size="30" placeholder="<?php echo $planes->habilitada->PlaceHolder ?>" value="<?php echo $planes->habilitada->EditValue ?>"<?php echo $planes->habilitada->EditAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_planes_habilitada" class="control-group planes_habilitada">
<span<?php echo $planes->habilitada->ViewAttributes() ?>>
<?php echo $planes->habilitada->ViewValue ?></span>
</span>
<input type="hidden" data-field="x_habilitada" name="x<?php echo $planes_grid->RowIndex ?>_habilitada" id="x<?php echo $planes_grid->RowIndex ?>_habilitada" value="<?php echo ew_HtmlEncode($planes->habilitada->FormValue) ?>">
<?php } ?>
<input type="hidden" data-field="x_habilitada" name="o<?php echo $planes_grid->RowIndex ?>_habilitada" id="o<?php echo $planes_grid->RowIndex ?>_habilitada" value="<?php echo ew_HtmlEncode($planes->habilitada->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($planes->cuotas->Visible) { // cuotas ?>
		<td>
<?php if ($planes->CurrentAction <> "F") { ?>
<span id="el$rowindex$_planes_cuotas" class="control-group planes_cuotas">
<input type="text" data-field="x_cuotas" name="x<?php echo $planes_grid->RowIndex ?>_cuotas" id="x<?php echo $planes_grid->RowIndex ?>_cuotas" size="30" placeholder="<?php echo $planes->cuotas->PlaceHolder ?>" value="<?php echo $planes->cuotas->EditValue ?>"<?php echo $planes->cuotas->EditAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_planes_cuotas" class="control-group planes_cuotas">
<span<?php echo $planes->cuotas->ViewAttributes() ?>>
<?php echo $planes->cuotas->ViewValue ?></span>
</span>
<input type="hidden" data-field="x_cuotas" name="x<?php echo $planes_grid->RowIndex ?>_cuotas" id="x<?php echo $planes_grid->RowIndex ?>_cuotas" value="<?php echo ew_HtmlEncode($planes->cuotas->FormValue) ?>">
<?php } ?>
<input type="hidden" data-field="x_cuotas" name="o<?php echo $planes_grid->RowIndex ?>_cuotas" id="o<?php echo $planes_grid->RowIndex ?>_cuotas" value="<?php echo ew_HtmlEncode($planes->cuotas->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($planes->gracia->Visible) { // gracia ?>
		<td>
<?php if ($planes->CurrentAction <> "F") { ?>
<span id="el$rowindex$_planes_gracia" class="control-group planes_gracia">
<input type="text" data-field="x_gracia" name="x<?php echo $planes_grid->RowIndex ?>_gracia" id="x<?php echo $planes_grid->RowIndex ?>_gracia" size="30" placeholder="<?php echo $planes->gracia->PlaceHolder ?>" value="<?php echo $planes->gracia->EditValue ?>"<?php echo $planes->gracia->EditAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_planes_gracia" class="control-group planes_gracia">
<span<?php echo $planes->gracia->ViewAttributes() ?>>
<?php echo $planes->gracia->ViewValue ?></span>
</span>
<input type="hidden" data-field="x_gracia" name="x<?php echo $planes_grid->RowIndex ?>_gracia" id="x<?php echo $planes_grid->RowIndex ?>_gracia" value="<?php echo ew_HtmlEncode($planes->gracia->FormValue) ?>">
<?php } ?>
<input type="hidden" data-field="x_gracia" name="o<?php echo $planes_grid->RowIndex ?>_gracia" id="o<?php echo $planes_grid->RowIndex ?>_gracia" value="<?php echo ew_HtmlEncode($planes->gracia->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($planes->descuenta->Visible) { // descuenta ?>
		<td>
<?php if ($planes->CurrentAction <> "F") { ?>
<span id="el$rowindex$_planes_descuenta" class="control-group planes_descuenta">
<input type="text" data-field="x_descuenta" name="x<?php echo $planes_grid->RowIndex ?>_descuenta" id="x<?php echo $planes_grid->RowIndex ?>_descuenta" size="30" placeholder="<?php echo $planes->descuenta->PlaceHolder ?>" value="<?php echo $planes->descuenta->EditValue ?>"<?php echo $planes->descuenta->EditAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_planes_descuenta" class="control-group planes_descuenta">
<span<?php echo $planes->descuenta->ViewAttributes() ?>>
<?php echo $planes->descuenta->ViewValue ?></span>
</span>
<input type="hidden" data-field="x_descuenta" name="x<?php echo $planes_grid->RowIndex ?>_descuenta" id="x<?php echo $planes_grid->RowIndex ?>_descuenta" value="<?php echo ew_HtmlEncode($planes->descuenta->FormValue) ?>">
<?php } ?>
<input type="hidden" data-field="x_descuenta" name="o<?php echo $planes_grid->RowIndex ?>_descuenta" id="o<?php echo $planes_grid->RowIndex ?>_descuenta" value="<?php echo ew_HtmlEncode($planes->descuenta->OldValue) ?>">
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$planes_grid->ListOptions->Render("body", "right", $planes_grid->RowCnt);
?>
<script type="text/javascript">
fplanesgrid.UpdateOpts(<?php echo $planes_grid->RowIndex ?>);
</script>
	</tr>
<?php
}
?>
</tbody>
</table>
<?php if ($planes->CurrentMode == "add" || $planes->CurrentMode == "copy") { ?>
<input type="hidden" name="a_list" id="a_list" value="gridinsert">
<input type="hidden" name="<?php echo $planes_grid->FormKeyCountName ?>" id="<?php echo $planes_grid->FormKeyCountName ?>" value="<?php echo $planes_grid->KeyCount ?>">
<?php echo $planes_grid->MultiSelectKey ?>
<?php } ?>
<?php if ($planes->CurrentMode == "edit") { ?>
<input type="hidden" name="a_list" id="a_list" value="gridupdate">
<input type="hidden" name="<?php echo $planes_grid->FormKeyCountName ?>" id="<?php echo $planes_grid->FormKeyCountName ?>" value="<?php echo $planes_grid->KeyCount ?>">
<?php echo $planes_grid->MultiSelectKey ?>
<?php } ?>
<?php if ($planes->CurrentMode == "") { ?>
<input type="hidden" name="a_list" id="a_list" value="">
<?php } ?>
<input type="hidden" name="detailpage" value="fplanesgrid">
</div>
<?php

// Close recordset
if ($planes_grid->Recordset)
	$planes_grid->Recordset->Close();
?>
<?php if ($planes_grid->ShowOtherOptions) { ?>
<div class="ewGridLowerPanel ewListOtherOptions">
<?php
	foreach ($planes_grid->OtherOptions as &$option)
		$option->Render("body", "bottom");
?>
</div>
<?php } ?>
</div>
</td></tr></table>
<?php if ($planes->Export == "") { ?>
<script type="text/javascript">
fplanesgrid.Init();
<?php if (EW_MOBILE_REFLOW && ew_IsMobile()) { ?>
ew_Reflow();
<?php } ?>
</script>
<?php } ?>
<?php
$planes_grid->ShowPageFooter();
if (EW_DEBUG_ENABLED)
	echo ew_DebugMsg();
?>
<?php
$planes_grid->Page_Terminate();
?>
